<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 400px;
            height: 400px;
            border: solid;
            margin: 100px 0px 0 100px;
            font-size: 2rem;
        }
    </style>
</head>

<body>

    <div id="box">
        hello box
    </div>
    <script>
        const box = document.getElementById('box');

        box.oncopy = function (e) {
            e.preventDefault()
            // console.log('hello copy');
            alert('请注册')
        }






    </script>

</body>

</html>